package IO;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class ObjectInputStreamObjectTypeDemo {
    public static void main(String[] args) {
        ObjectInputStream ois = null;
        try{
            ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream("d:/objecttypedata.txt")));
            Users users =(Users)ois.readObject();
            System.out.println("id:"+users.getUid()+" name:"+users.getUname()+" age:"+users.getUage());
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try{
                if(ois != null){
                    ois.close();
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
}
